package com.developer.fans.info;

import android.widget.LinearLayout;
import android.widget.TextView;

import com.developer.fans.CrackApplication;
import com.developer.fans.MainActivity;

/**
 * Created by lu on 15-8-12.
 */
public class AppStoreInfoView extends MainActivity.CrackItemView {
    public AppStoreInfoView() {
        super("应用圈信息");
        LinearLayout root = new LinearLayout(CrackApplication.getContext());
        root.setOrientation(LinearLayout.VERTICAL);
        setContentView(root);

        try {
            CrackApplication.AppStoreInfo i = CrackApplication.getAppStoreInfo();
            root.addView(createText(new StringBuffer("VersionName:").append(i.versionName).toString()));
            root.addView(createText(new StringBuffer("CC:").append(i.content_channel).toString()));
            root.addView(createText(new StringBuffer("DC:").append(i.device_channel).toString()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private TextView createText(String text) {
        TextView textView = new TextView(CrackApplication.getContext());
        textView.setText(text);
        return textView;
    }
}
